﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using V5_Model;
using V5_Common;
using V5_BLL;

namespace V5_EShop.Controls
{
    public partial class getProductSingleClassList : System.Web.UI.UserControl
    {
        protected ModelProductClass productclass = new ModelProductClass();
        int classID = 0;
        string paramValue = "";

        public string ParamValue
        {
            get { return paramValue; }
            set { paramValue = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                classID = Input.SetInt(Request["classid"]);
                Bind_rpList();
            }
        }

        private void Bind_rpList()
        {
            if (ParamValue.Length > 0)
            {
                int _classID = Input.SetInt(Input.TagVal(ParamValue,"ClassID"));
                if (_classID > 0)
                {
                    classID = _classID;
                }
            }
            productclass = new BLLProductClass().GetModel(classID);
            this.rpList.DataSource = new BLLProductClass().GetList(0," ParentID="+classID," ClassID desc").Tables[0];
            this.rpList.DataBind();
        }
    }
}